package day05;

import java.util.Random;


public class MethodDemo2 {
    public static void main(String[] args) {
        int a=sum(11,89);
        System.out.println(a);
        int m =11,n=22;
        int b=sum(m,n);
        System.out.println(b);

        int[]aa=gennerteAraay(5,30);
        System.out.println(aa[2]);
        for (int i=0;i<aa.length;i++){
            System.out.println(aa[i]);
        }
    }
    public static int sum(int num1,int num2){
        int num=num1+num2;
        return num;
    }

    public static int[] gennerteAraay(int len,int max){
        Random rand=new Random();
        int[]arr=new int[len];
        for (int i=0;i<arr.length;i++){
            arr[i]= rand.nextInt(max+1);
        }
        return arr;
    }
}
